
package biblio.util.interfaces;


import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


/**
 * Defines operations on context from JSF framework.
 * @author mephisto
 * 2011-10-28
 */
public interface RequestOperationHelper
{

    /**
     * Returns bean identified by {@code attributeName} from the request.
     *
     * @param attributeName the name of attribute to set
     * @return appropriate Bean instance which was sent by a client (f.e web browser)
     * under name attributeName. If under this name is no bean, returns null
     */
    Object getBean(String attributeName);

    /**
     * Returns the external context of JSF.
     *
     * @return the external context of JSF.
     */
    ExternalContext getExternalContext();

    /**
     * Returns the faces context of JSF.
     *
     * @return the faces context of JSF.
     */
    FacesContext getFacesContext();

    /**
     * Returns HttpServletRequest instance.
     *
     * @return HttpServletRequest instance
     */
    HttpServletRequest getRequest();

    /**
     * Returns HttpServletResponse instance.
     * 
     * @return HttpServletResponse instance
     */
    HttpServletResponse getResponse();
}
